home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / SunLabs / tclTK / src / tcl7.4 / tests / misc.test < prev    next >
Encoding:
Text File  |  1994-12-18  |  2.0 KB  |  71 lines

  1. # Commands covered:  various
  2. #
  3. # This file contains a collection of miscellaneous Tcl tests that
  4. # don't fit naturally in any of the other test files.  Many of these
  5. # tests are pathological cases that caused bugs in earlier Tcl
  6. # releases.
  7. #
  8. # Copyright (c) 1992-1993 The Regents of the University of California.
  9. # Copyright (c) 1994 Sun Microsystems, Inc.
  10. #
  11. # See the file "license.terms" for information on usage and redistribution
  12. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  13. #
  14. # @(#) misc.test 1.4 94/12/17 16:20:14
  15.  
  16. if {[string compare test [info procs test]] == 1} then {source defs}
  17.  
  18. test misc-1.1 {error in variable ref. in command in array reference} {
  19.     proc tstProc {} {
  20.     global a
  21.     
  22.     set tst $a([winfo name $zz])
  23.     # this is a bogus comment
  24.     # this is a bogus comment
  25.     # this is a bogus comment
  26.     # this is a bogus comment
  27.     # this is a bogus comment
  28.     # this is a bogus comment
  29.     # this is a bogus comment
  30.     # this is a bogus comment
  31.     }
  32.     set msg {}
  33.     list [catch tstProc msg] $msg
  34. } {1 {can't read "zz": no such variable}}
  35. test misc-1.2 {error in variable ref. in command in array reference} {
  36.     proc tstProc {} "
  37.     global a
  38.     
  39.     set tst \$a(\[winfo name \$\{zz)
  40.     # this is a bogus comment
  41.     # this is a bogus comment
  42.     # this is a bogus comment
  43.     # this is a bogus comment
  44.     # this is a bogus comment
  45.     # this is a bogus comment
  46.     # this is a bogus comment
  47.     # this is a bogus comment
  48.     "
  49.     set msg {}
  50.     list [catch tstProc msg] $msg $errorInfo
  51. } [list 1 {missing close-brace for variable name} \
  52. [format {missing close-brace for variable name
  53.     while executing
  54. "winfo name $%szz)
  55.     # this is a bogus comment
  56.     # this is a bogus comment
  57.     # this is a bogus comment
  58.     # this is a bogus comment
  59.     # this is a bogus commen ..."
  60.     (parsing index for array "a")
  61.     invoked from within
  62. "set tst $a([winfo name $%szz)
  63.     # this is a bogus comment
  64.     # this is a bogus comment
  65.     # this is a bogus comment
  66.     # this is a bogus comment
  67.     # this is a  ..."
  68.     (procedure "tstProc" line 4)
  69.     invoked from within
  70. "tstProc"} \{ \{]]
  71.